<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>电话列表</title>
    <jsp:include page="/commons/common-js.jsp"></jsp:include>
</head>
<body>
<div style="width: 100%;overflow:auto;margin-top: 10px;" id="tablediv">
    <div style="margin:0 auto; width:97%; float:none; display:block;">
        <table id="adminList" class="easyui-datagrid" title="电话列表" height="auto" style="width:100%;overflow:hidden;"
               data-options="singleSelect:false,collapsible:true,pagination:true,flt:true,pageSize:20,toolbar:toolbar,
				loadMsg:'加载中...',url:'${pageContext.request.contextPath}/admin/list'">
            <thead>
            <tr>
            	<th data-options="field:'ck',checkbox:true"></th>
                <th data-options="field:'id',align:'center',width:'5%'">用户id</th>
                <th data-options="field:'username',align:'center',width:'25%'">账号</th>
                <th data-options="field:'password',align:'center',width:'20%'">密码</th>
                <th data-options="field:'createTime',align:'center',width:'25%',formatter:TAOTAO.formatDateTime">开通时间</th>
                <th data-options="field:'certName',align:'center',width:'25%'">姓名</th>
            </tr>
            </thead>
        </table>
    </div>
    <div id="adminAddWindow" class="easyui-window" title="新增用户" data-options="modal:true,closed:true,iconCls:'icon-save',href:'${pageContext.request.contextPath}/page/user_add'" style="width:40%;height:40%;padding:10px;">
</div>
<script type="text/javascript">
//$("#userUpdateList").datagrid('hideColumn', 'verifyId'); 
function getSelectionsIds(){
	var itemList = $("#adminList");
	var sels = itemList.datagrid("getSelections");
	var ids = [];
	for(var i in sels){
		ids.push(sels[i].id);
	}
	ids = ids.join(",");
	return ids;
}

var toolbar = [{
    text:'新增',
    iconCls:'icon-add',
    handler:function(){
    	/* $(".tree-title:contains('新增景点')").parent().click(); */
    	$('#adminAddWindow').window('open');
    }
},{
    text:'解绑',
    iconCls:'icon-ok',
    handler:function(){
    	var ids = getSelectionsIds();
    	if(ids.length == 0){
    		$.messager.alert('提示','未选中用户!');
    		return ;
    	}
    	var params = {"ids":ids};
    	$.post("${pageContext.request.contextPath}/admin/unbundling",params, function(data){
			if(data.status == '000'){
					$.messager.alert('系统提示',data.msg);
					$("#adminList").datagrid("reload");
			}
		});
    }
}/* ,{
    text:'不通过',
    iconCls:'icon-cancel',
    handler:function(){
    	var ids = getSelectionsIds();
    	if(ids.length == 0){
    		$.messager.alert('提示','未选中用户!');
    		return ;
    	}
    	    	var params = {"ids":ids};
    	    	$.post("${ctx}/user/verifyUsersFail${sfix}",params, function(data){
    				if(data.status == '000'){
    						$("#userUpdateList").datagrid("reload");
    				}
    			});
    }
} *//* ,'-',{
    text:'原资料',
    iconCls:'icon-remove',
    handler:function(){
    	var ids = getSelectionsIds();
    	if(ids.length == 0){
    		$.messager.alert('提示','未选中一个用户!');
    		return ;
    	}
    }
} */];

	
</script>

</body>


</html>